package com.mikufufu.blog.common.entity;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 分页查询通用实体类
 * 
 */
@Data
public class Query {

    /**
     * 当前页码
     */
    @ApiModelProperty("当前页码")
    private Integer current = 1;

    /**
     * 每页条数
     */
    @ApiModelProperty("每页条数")
    private Integer size =10;

    public <T> IPage<T> getPage() {
        return new Page<>(this.current <= 0? 1 : this.current, this.size);
    }
}